import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';

const IconExample = () => {
  return (
    <View style={styles.container}>
      <Icon name="home" size={30} color="#900" />
      <Icon name="user" size={30} color="#4F8EF7" />
      <Icon name="heart" size={30} color="#e74c3c" />
      <Text style={styles.text}>
        <Icon name="star" size={20} color="#f1c40f" /> 带图标的文本
      </Text>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    gap: 20,
  },
  text: {
    fontSize: 16,
    color: '#333',
  },
});

export default IconExample;